-content_for :widget_title do
  Selected Sections

-content_for :widget_buttons do
  =link_to mapping_map_rcontrol_path, :method => :post, :remote => true, :id => :rmap, :class => %w(btn widgetbtn btn-warning) do
    %span Map section to control
    %i.gcmsicon-play-white

#selected_sections.description{:oid => section ? section.id : ""}
  .clearfix

  .content
    -if section
      %ul.sectiontree
        /-sections = Section.slugfilter(section.slug)
        -sections = Section.find_descendents_by_slug(section.slug)
        =walk_slug_tree(Program.slugtree([section] + sections), 2) do |item, step|
          %div
            %span.prefix
              =item.slug
            =item.title
          -if !item.description.blank?
            %textarea(disabled='disabled' style='width: 98%')
              =item.description
    -else
      Nothing selected.

:javascript
  $(document).ready(function(){
    update_map_buttons();
  });
